package com.tj.collection.enums;

public enum MemberStatusEnum {

    INIT(1,"初始化"),
    FINISH(2,"已完成注册"),
    CANCEL(3,"注销");

    private Integer code;

    private String description;

    MemberStatusEnum(Integer code, String description) {
        this.code = code;
        this.description = description;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public static MemberStatusEnum getEnumByCode(Integer code) {
        for (MemberStatusEnum item : MemberStatusEnum.values()) {
            if (item.code.equals(code)) {
                return item;
            }
        }
        return null;
    }
}
